<?php include MOBILE_COMMON_PATH.'/header.html'; ?>
<section class="content weui-msg">
	<?php if($type):?>
		<?php if($code=='success'):?>
		<div class="weui-msg__icon-area"><img class="icon_tips center" src="/res/mobile/images/msg/<?php echo $type;?>_success.png" alt=""></div>
		<?php else:?>
		<div class="weui-msg__icon-area"><img class="icon_tips center" src="/res/mobile/images/msg/<?php echo $type;?>_error.png" alt=""></div>
		<?php endif;?>
	<?php else:?>
		<?php if($code=='success'):?>
		<div class="weui-msg__icon-area"><i class="weui-icon-success weui-icon_msg"></i></div>
		<?php else:?>
		<div class="weui-msg__icon-area"><i class="weui-icon-warn weui-icon_msg-primary"></i></div>
		<?php endif;?>
	<?php endif;?>

    <div class="weui-msg__text-area">
        <h2 class="weui-msg__title"><?php echo $msg;?></h2>
        <p class="weui-msg__desc" id="countdown"><b>5</b>秒后自动返回</p>
    </div>
    <div class="weui-msg__opr-area">
        <p class="weui-btn-area">
            <a href="<?php echo $url;?>" class="weui-btn weui-btn_primary">确定</a>
        </p>
    </div>
</section>
<?php include MOBILE_COMMON_PATH.'/footer.html'; ?>
<script type="text/javascript">
    (function(){
        var countDiv = document.getElementById('countdown');
        var bText = countDiv.getElementsByTagName('b')[0];
        var aNumber = parseInt(bText.innerHTML);
        function countDown(){
            aNumber--;
            if (aNumber>0) {
                bText.innerHTML = aNumber;
                timer = setTimeout(countDown,1000);
            } else {
                location.href=location.origin+'<?php echo $url;?>';
            }
        }
        var timer = setTimeout(countDown,1000);
    })();
</script>